QuickTime 3 Reference

Previous | Chapter Top | Chapter Contents | Next

Validating and Retrieving Image Data

GraphicsImportValidate

Validates image data for a data reference.

pascal ComponentResult GraphicsImportValidate (
                     GraphicsImportComponent ci,
                     Boolean *valid)
ci
Specifies the component instance that identifies your connection to the graphics importer component.
valid
Pointer to a Boolean value. On return, this parameter is set to true if the the graphics importer component can draw the data reference. If the graphics importer component cannot draw the data reference, this parameter is set to false .

DISCUSSION

The GraphicsImportValidate functions allows a graphics importer component to determine if its current data reference contains valid image data. For example, a JFIF graphics importer component might check for the presence of a JFIF marker in the data reference. This function is provided for applications to use to determine what type of image data a particular file may contain. Sometimes a file may not have the correct file type or file extension. In this case, the application will not know which graphics importer component to use. By iterating through all graphics importer components and calling GraphicsImportValidate for each one, it may be possible to locate a graphics importer component that can draw the specified file.

Not all graphics importer components implement this function. A component that does not implement the function will return the badComponentSelector result code. This does not indicate that the file is valid or invalid.

RESULT CODES

noErr

0

No error

paramErr

-50

Invalid parameter specified

memFullErr

-108

Not enough memory available

badComponentSelector

0x80008002

Component does not support the specified request code

GraphicsImportReadData

Reads image data.

extern pascal ComponentResult GraphicsImportReadData (
                     GraphicsImportComponent ci,
                     void *dataPtr,
                     unsigned long dataOffset,
                     unsigned long dataSize);
ci
Specifies the component instance that identifies your connection to the graphics importer component.
dataPtr
A pointer to a memory block to receive the data.
dataOffset
The offset of the image data within the data reference. The function begins reading image data from this offset.
dataSize
The number of bytes of image data to read.

DISCUSSION

GraphicsImportReadData communicates with the appropriate data handler to retrieve image data. Typically only developers of graphics importer components will need to use this function. This function should always be used to retrieve data from the data source, rather than reading it directly.

RESULT CODES

noErr

0

No error

paramErr

-50

Invalid parameter specified

memFullErr

-108

Not enough memory available

 


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next